package com.bieyang.anjia.utils;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;

/**
 * HTTP请求构造工厂 模拟浏览器功能
 * 
 * @author Administrator
 * 
 */
public class HttpClientFactory {
	private static HttpClientFactory factory;
	//private HttpClient httpClient;
	private static final Object lock = new Object();

	public HttpClientFactory() {
		//this.httpClient = new CookieHttpClient();
	}

	public static HttpClientFactory getFactory() {
		if (factory == null) {
			synchronized (lock) {
				if (factory == null) {
					factory = new HttpClientFactory();
				}
			}
		}
		return factory;
	}

	public HttpClient getHttpClient() {
		return new CookieHttpClient();
	}

}
